window.UIMonitor2 = {bi: {visitor_id: 'fd9ko0',session_id: '24r7b9h',pageview_id: '5z.4qs21u6tv',script_init: window.__uidc_init || 0,script_load: new Date * 1,script_request: 1338298182223,script_ready: 1338298182223,script_code: 314739}};
window.UIMonitor2.now = '2012-5-29 13:29:42';window.UIMonitor2.arrIds = {};if(window.$trackEvent){$trackEvent_=$trackEvent;$trackEvent=function(c){if(c!='tuna-error'){$trackEvent_.apply(null,arguments);}};};;(function(ns,win){var win=win
var ready=ns.ready=function(){var readyBound=false,readyList=[],DOMContentLoaded;if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener('DOMContentLoaded',DOMContentLoaded,false);ready();};}else if(document.attachEvent){DOMContentLoaded=function(){if(document.readyState==='complete'){document.detachEvent('onreadystatechange',DOMContentLoaded);ready();}};}
function ready(){if(!ready.isReady){ready.isReady=true;for(var i=0,j=readyList.length;i<j;i++){readyList[i]();}}}
function doScrollCheck(){try{document.documentElement.doScroll("left");}catch(e){setTimeout(doScrollCheck,1);return;}
ready();}
function bindReady(){if(readyBound){return;}
readyBound=true;if(document.readyState==='complete'){ready.isReady=true;}else{if(document.addEventListener){document.addEventListener('DOMContentLoaded',DOMContentLoaded,false);ns.addEventListener('load',ready,false);}else if(document.attachEvent){document.attachEvent('onreadystatechange',DOMContentLoaded);ns.attachEvent('onload',ready);var toplevel=false;try{toplevel=ns.frameElement==null;}catch(e){}
if(document.documentElement.doScroll&&toplevel){doScrollCheck();}}}}
bindReady();return function(callback){ready.isReady?callback():readyList.push(callback);};}();ready.isReady=false;})(window,window);if(typeof(window.$location)=="undefined"){window.$location=function(url){if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var referLink=document.createElement('a');referLink.href=url;document.body.appendChild(referLink);referLink.click();}else{location.href=url;}}};(function(U){if(!Array.prototype.map){Array.prototype.map=function(fun){var len=this.length;if(typeof fun!="function")
throw new TypeError();var res=new Array(len);var thisp=arguments[1];for(var i=0;i<len;i++){if(i in this){res[i]=fun.call(thisp,this[i],i,this);}}
return res;}};if(!String.prototype.replaceWith){String.prototype.replaceWith=function(d){return this.replace(/\{\$(\w+)\}/g,function(a,c){if(c in d){return d[c];}else{return a;}});}};if(!Function.prototype.bind){Function.prototype.bind=function(a){var c=this;var d=[].slice.call(arguments,1);return function(){return c.apply(a,d.concat([].slice.call(arguments,0)));};}};U.commonInfo=function(){var w=window,l=w.location,d=w.document,n=w.navigator,s=w.screen,b=U.browserInfo(),c=U.cookieInfo(),o=U.bi,t=U.timeInfo,i=U.identityInfo;return[l.hostname,l.pathname,(function(){var noseo=l.href.match(/\?(.*)/);var seo=l.href.match(/\#(.*)/);if(noseo&&noseo.length>1){return noseo[1].replace("?",'');}
if(seo&&seo.length>1){return seo[1].replace("?",'');}
return"";})(),d.referrer,i('page_id'),i('page_state'),c.v_id,c.v_sessions,c.v_pageviews,c.v_old_pageviews,c.v_last_pageview,c.s_id,c.b_id,o.pageview_id,i('pv_foreign_id'),o.script_init,o.script_load,t('dom_ready'),t('load'),t('unload'),o.script_request,o.script_ready,n.platform,b.engine,s.width+'x'+s.height,w.history.length,b.flash,(function(){if(window['dialogArguments']){return document.cookie.length?1:0;}else{return n.cookieEnabled?1:0}})(),('javaEnabled'in n)&&n.javaEnabled()?1:0,n.language||[n.browserLanguage,n.userLanguage,n.systemLanguage].join('/'),n.onLine?1:0,n.vendor||'',(n.product||'')+'/'+(n.productSub||'')];};U.browserInfo=function(){var Engine={'name':'unknown','version':0};var is360=(function(){var isChrome=/Chrome/i.test(navigator.userAgent)&&/webkit/i.test(navigator.userAgent);if(isChrome){if(navigator.mimeTypes[2].suffixes=='swf'){return'360js';}}
if(navigator.userAgent.toLowerCase().indexOf('360se')>-1){return'360se';}
return'';})();var Engines={presto:function(){return((!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925)))+is360;},trident:function(){return((!window.ActiveXObject)?false:((window.XMLHttpRequest)?5:4))+is360;},webkit:function(){return((navigator.taintEnabled)?false:(document.evaluate?(document.querySelector?525:420):419))+is360;},gecko:function(){return((document.getBoxObjectFor==undefined)?false:((document.getElementsByClassName)?19:18))+is360;}};for(var engine in Engines){var version=Engines[engine]();if(version){Engine={'name':engine,'version':version};break;}}
var s='0 r0';try{s=navigator.plugins['Shockwave Flash'].description;}catch(e){try{s=new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');}catch(e){}}
var version=s.match(/\d+/g);var Flash={'version':parseInt(version[0]||0+'.'+version[1]||0),'build':parseInt(version[2]||0)};return{'engine':Engine.name+'/'+Engine.version,'flash':Flash.version+'/'+Flash.build};};U.timeInfo=function(k){var obj=arguments.callee._val;if(!obj){var obj={'script_load':U.bi.script_load,'dom_ready':0,'load':0,'unload':0};U.register('domready',function(){obj.dom_ready=new Date*1});U.register('load',function(){obj.load=new Date*1});U.register('beforeunload',function(){obj.unload=new Date*1});arguments.callee._val=obj;}
return[obj,k];};U.identityInfo=function(k){var obj=arguments.callee._val;if(!obj){var obj={'page_id':'','page_state':'','pv_foreign_id':''};U.register('domready',function(){obj.page_id=U.getVal('page_id');obj.page_state=U.getVal('htlPageState');obj.pv_foreign_id=U.getVal('htlPageView');});arguments.callee._val=obj;}
return[obj,k];};U.ii=function(k){return U.identityInfo(k)[0][k];};U.cookieInfo=function(){var o=U.bi;var v=U.getCookie('i_v');var s=U.getCookie('i_s');var b=U.getCookie('i_b');var x=U.getCookie('uig');if(x.vi){v.o=x.vi;U.setCookie(x,new Date(0));}else{v.o=0;}
if(v.i=='15y9n3')delete v.i;if(!v.i){v.i=o.visitor_id;v.p=1;v.l='';v.s=1;s.i=o.session_id;b.i=(new Date*1).toString(36);}else{++v.p;if(s.i!=o.session_id){++v.s;if(!s.i)s.i=o.session_id;}
if(!b.i)b.i=(new Date*1).toString(36);}
var r={'v_id':parseInt(v.i||'0',36),'v_sessions':v.s,'v_pageviews':v.p,'v_old_pageviews':v.o,'v_last_pageview':v.l,'s_id':parseInt(s.i,36),'b_id':parseInt(b.i,36)};v.l=o.pageview_id;U.setCookie(v,new Date(2037,6,10));U.setCookie(s,new Date(new Date*1+30*60*1000));U.setCookie(b);return r;};U.register=function(evt,fn){var ar=U['f_'+evt];if(!ar){ar=U['f_'+evt]=[];U.listen(window,evt,function(ev){for(var i=0;i<ar.length;i++)try{ar[i](ev)}catch(e){}});}
ar.push(fn);};U.listen=function(el,evt,fn,useCapture){if(evt=='domready'){window.ready(fn);return;}
if(el.attachEvent)el.attachEvent('on'+evt,fn);else el.addEventListener(evt,fn,useCapture);};U.getVal=function(id){var el=document.getElementById(id);return(el&&el.value)||'';};U.getCookie=function(key){var ret={'__k':key};var r=new RegExp('(^|; )'+key+'=([^;]*)');var m=document.cookie.match(r);var a=m?m[2].split('&'):[];for(var i=0;i<a.length;i++){var p=a[i].split('=');if(p.length>1)ret[p[0]]=unescape(p[1]);}
return ret;};U.setCookie=function(obj,exp){var k=obj.__k;delete obj.__k;var a=[];for(var s in obj)if(obj.hasOwnProperty(s))a.push(s+'='+escape(obj[s]));var c=[k+'='+a.join('&'),'domain='+location.hostname.split('.').slice(-2).join('.'),'path=/'];if(exp)c.push('expires='+exp.toGMTString());document.cookie=c.join('; ');};U.serverUrl=function(){var h=location.hostname;if(/\bctriptravel\b/i.test(h))return'http://www.dev.sh.ctriptravel.com/rp/uiServer2.asp';return'http://www.ctrip.com/rp/uiServer2.asp';};U.trackEvent=function(category,action,label,value){U.get({'action':'event','p':U.bi.pageview_id,'u':document.URL,'c':category,'l':label,'a':action,'v':value,'t':new Date*1});};U.xpath=function(obj){var arr=[],iTemp=0;function getTagIndex(tag){var begin=0;if(!tag.parentNode)
return"";var firstChild=tag.parentNode.firstChild;while(firstChild){if(firstChild==tag){return begin==0?'':"["+(begin+1)+"]";}
if(firstChild.nodeType==1&&firstChild.tagName==tag.tagName){begin++;}
firstChild=firstChild.nextSibling;}
return"";};while(obj){arr[iTemp++]=obj.nodeName+getTagIndex(obj);if(obj.tagName!="HTML"){obj=obj.parentNode;}else{break;}}
return arr.reverse();};U.netSpeed=function(){var beginDate=new Date();var spimg=new Image();spimg.onload=function(){var val=((new Date()-beginDate)/1000);val=val?val:1;var url=document.location.protocol+'//s.c-ctrip.com/?ac=speed&pv={$0}&pi={$1}&url={$2}&speed={$3}&_nd={$4}'.replaceWith([U._visitId||0,U.ii('page_id')||U._pageId,location.href,0.4970703125/val,(+beginDate)].map(encodeURIComponent));new Image().src=url;};spimg.src=document.location.protocol+"//s.c-ctrip.com/speed.jpg";};U.getPageSpeed2=function(){var strarr=["domComplete","navigationStart","redirectEnd","redirectStart","domainLookupStart","fetchStart","domainLookupEnd","connectEnd","connectStart","responseStart","requestStart","responseEnd","domLoading","loadEventEnd","loadEventStart","unloadEventStart","unloadEventEnd","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd"];var urlarr=[(U.ii('page_id')||U._pageId)];for(var i=0;i<strarr.length;i++){urlarr.push(window.performance.timing[strarr[i]]);}
urlarr.push(window.performance.navigation.type);urlarr.push(window.performance.navigation.redirectCount);return urlarr;};U.getPageSpeed=function(){var T=window.performance.timing;var __uidc_init=(window['__uidc_init']||0)-T.navigationStart;var __jsloadtime=(window['__jsloadtime']||0)-T.navigationStart;var arr=[U.ii('page_id')||U._pageId,__uidc_init>90000?0:__uidc_init,__jsloadtime>90000?0:__jsloadtime,T.redirectEnd-T.redirectStart,T.domainLookupStart-T.fetchStart,T.domainLookupEnd-T.domainLookupStart,T.connectEnd-T.connectStart,T.responseStart-T.requestStart,T.responseEnd-T.responseStart,T.domComplete-T.domLoading,T.loadEventEnd-T.loadEventStart,T.unloadEventStart-T.unloadEventEnd,performance.navigation.type,performance.navigation.redirectCount];for(var i=0;i<arr.length;i++){arr[i]=Math.max(0,arr[i]*1);}
return arr;},U.pageSpeed=function(){if(window.performance&&(U.ii('page_id')||U._pageId)){var beginDate=new Date();var spimg=new Image();if(window.performance.timing.domComplete){var url2=document.location.protocol+'//s.c-ctrip.com/?ac=ps2&data={$0}'.replaceWith([U.getPageSpeed2().join(',')]);new Image().src=url2;}else{setTimeout(arguments.callee,200);}}};U.trackLog=function(pi,key,value){var url=document.location.protocol+'//s.c-ctrip.com/?ac=tl&pi={$0}&key={$1}&val={$2}&_nd={$3}'.replaceWith([pi||U.ii('page_id'),key,value,(+new Date())].map(encodeURIComponent));new Image().src=url;};U.pvid=null;U.getPvId=function(){if(!U.pvid){U.pvid=parseInt(U.bi.pageview_id.match(/(.+)\./)[1],36).toString()+parseInt(U.bi.pageview_id.match(/\.(.+)/)[1],36).toString();}
return U.pvid?U.pvid:false;};U.recordClick_beta=function(e){var ev=e||window.event;var el=e.srcElement||e.target;if(!el||!el.parentNode||el==document)return;var mid=parseInt((document.documentElement.clientWidth||document.body.clientWidth)/2,10);var x=('pageX'in ev)?ev.pageX-mid:ev.x+document.body.scrollLeft+document.documentElement.scrollLeft-mid;var y=('pageY'in ev)?ev.pageY:ev.y+document.body.scrollTop+document.documentElement.scrollLeft;if(!U.getPvId)return;var url=document.location.protocol+'//s.c-ctrip.com/?ac=record&pv={$0}&pi={$1}&ct={$2}&x={$3}&y={$4}&xp={$5}'.replaceWith([U.getPvId()||0,U.ii('page_id')||U._pageId,new Date().getTime(),x,y,U.xpath(el).join('/')+'/'].map(encodeURIComponent));new Image().src=url;};U.xpath3=function(el,ref){if(el==(ref||document.documentElement))return'';if(el.id){if(!/^uid_\d+/.test(el.id)){return'#'+el.id;}
if(el.type=='radio'&&el.name){return'@'+el.name+'='+el.value;}}
var pa=el.parentNode;var tg=el.tagName;if(!pa)return'!fly';for(var i=0,x=0,ch=pa.childNodes;i<ch.length;i++){if(ch[i]==el)break;if(ch[i].tagName==tg)++x;}
var cl=el.className?'.'+el.className:'';return U.xpath3(pa,ref)+'/'+tg.toLowerCase()+'['+x+']'+cl;};U.recordClick2=function(e){var de=document.documentElement;var ev=e||window.event;if(ev.which){if(ev.which!=1)return;}else if(e.button>1){return;}
var el=ev.srcElement||ev.target;if(!el||!el.parentNode||el==de)return;var ref=document.getElementById('toolkit');U.get({'action':'v1click','d':U.pack([U._visitId||0,U.bi.pageview_id,U.ii('page_id'),new Date().getTime(),(ev.pageX||ev.clientX+de.scrollLeft||0)-(ref?ref.offsetLeft:0),ev.pageY||ev.clientY+de.scrollTop||0,el.id,el.name||'',el.className,U.xpath3(el),document.documentElement.clientWidth,document.body.scrollHeight]),'t':new Date().getTime()});};U.append=function(key,val){if(val!==null)U.data.x.push(String.fromCharCode(1)+key+String.fromCharCode(2)+val);};U.get=function(dat,cb){if(top==window){var ar=[];for(var s in dat)if(dat.hasOwnProperty(s))ar.push(s+'='+encodeURIComponent(escape(dat[s])));var Session=document.cookie.match(/Session=([^;]+)/);var _ctm_t=document.cookie.match(/_ctm_t=([^;]+)/);var union=U.getCookie('Union');var unionstr=union.AllianceID?"&AllianceID="+union.AllianceID:"";unionstr+=union.SID?"&SID="+union.SID:"";if(cb){var head=document.getElementsByTagName('head')[0]||document.documentElement;head.appendChild(document.createElement('script')).src=U.serverUrl()+'?'+ar.join('&')+(Session?"&"+Session[1].replace(/%25/g,'%'):'')+(_ctm_t?'&_ctm_t='+_ctm_t[1]:'')+(unionstr?unionstr:'');}else{new Image().src=U.serverUrl()+'?'+ar.join('&')+(Session?"&"+Session[1].replace(/%25/g,'%'):'')+(_ctm_t?'&_ctm_t='+_ctm_t[1]:'')+(unionstr?unionstr:'');}}};U.log=function(s){if(window.console)console.log(s);else(U._log||(U._log=[])).push(s);};U.pack=function(a){var d=[];for(var i=0;i<a.length;i++){var x=a[i]instanceof Array?a[i][0][a[i][1]]:a[i];d.push(typeof x=='number'?x:x="'"+(x+'').replace(/'/g,"''")+"'");}
return d.join(',');};U.hvSearchResultAPI=function(){if(document.getElementById("page_id")){var pageid=document.getElementById("page_id").value;if(pageid=="102002"||pageid=="10300200"){U.hvResultLog=function(value){U.bi.session_id;U.bi.visitor_id;U.bi.pageview_i;var sendValue=[pageid,U.bi.session_id,U.bi.visitor_id,U.bi.pageview_i].join(',');sendValue+=value;};}}};U.beforeunloadExist=function(){if(!window.performance)
return;var existTime=(new Date()).valueOf()-window.performance.timing.navigationStart;if(!document.getElementById("page_id"))
return;var pageid=document.getElementById("page_id").value;if(!U.getPvId())return;var sendValue=[U.bi.session_id,U.getPvId(),existTime].join(',');U.trackLog(pageid,"et",sendValue);};U.start=function(){if(U._startTimer){clearInterval(U._startTimer);U._startTimer=null;U.get({'action':'v1','d':U.pack(U.data.c),'c':U.bi.script_code,'t':new Date().getTime()},true);var pi=U.ii('page_id');var lp=location.pathname;var de=document.documentElement;(function(){var once=false;var moni=function(pg,io,cf){U.listen(de,"mousedown",function(e){e=e||event;var el=e.target||e.srcElement;if(!el||!el.parentNode)return;var tp='justclick';for(var s in cf)if(cf.hasOwnProperty(s)){if(typeof cf[s]=='string'?el.id==cf[s]:cf[s](el)){tp=s;break;}}
if(once&&tp=='justclick')return;once=true;U.trackEvent('htlcmt',pg+'_'+io,tp,parseInt(U.bi.session_id,36));});};if(pi=='102001'||lp=='/international/'&&location.host=='hotels.ctrip.com'){moni('query',pi=='102001'?0:1,{'bigscore':function(el){return el.tagName=='A'&&el.parentNode.className=='score';},'bigscore_hotel':function(el){return el.tagName=='A'&&el.parentNode.className=='hotel_name';},'city':function(el){return el.parentNode.className=='title'&&el==el.parentNode.getElementsByTagName('a')[0];},'city_hotel':function(el){return el.parentNode.className=='title'&&el==el.parentNode.getElementsByTagName('a')[1];}});}else if(pi=='102002'||lp=='/international/ShowHotelList.aspx'){moni('list',pi=='102002'?0:1,{'viewcomment':function(el){return(el.className||el.parentNode.className)=='hotel_value';}});}else if(pi=='102023'){moni('detail',document.getElementById('ctl00_ctl02_classEnglishHotels')&&document.getElementById('ctl00_ctl02_classEnglishHotels').className=='base_nav_current'?1:0,{'commentcount':'ctl00_MainContentPlaceHolder_lnkReview','iwantcomment':'ctl00_MainContentPlaceHolder_lnkCommand'});}})();var pageId=0;if(document.getElementById('page_id')){pageId=document.getElementById('page_id').value;}
var arrIds=U.arrIds;function checkIds(pageId){return true;};if(/^\/beta\//.test(lp)||checkIds(pageId)){var hs=[['/beta/hotel/',1001],['/beta/hotelIntl/',1002],['/beta/flight/',1003],['/beta/flightIntl/',1004],['/beta/vacations/',1005],['/beta/',1000]];U._pageId=0;for(var i=0;i<hs.length;++i){if(lp.indexOf(hs[i][0])==0){U._pageId=hs[i][1];break;}}
U.listen(de,"mousedown",U.recordClick_beta,true);}
var m_keyword=document.getElementById("m_keyword");if(m_keyword){if(document.URL.match(/SearchNoResult/)){U.trackLog(document.getElementById("page_id").value,"help",m_keyword.value)}}
U.pageSpeed();}};U.callback=function(a,str){if(a=='v1'){var n=parseInt(str,10);if(n>0){U._visitId=n;var c={};c.__k='pv_id';c.v=U._visitId;U.setCookie(c);}}};U.end=function(){if(U._startTimer){var obj=U.identityInfo('page_id')[0];obj['page_state']='start_at_end';U.start();}
var d=[U._visitId||0],f=[4,5,13,14,17,18,19];for(var i=0,a=U.data.c;i<f.length;i++){var j=f[i];var x=a[j]instanceof Array?a[j][0][a[j][1]]:a[j];d.push(typeof x=='number'?x:x="'"+(x+'').replace(/'/g,"''")+"'");}
U.get({'action':'v1ex','d':d.join(','),'t':new Date().getTime()});};if(/\.ctrip(travel)?\.com$/.test(location.hostname)){U.data={'c':U.commonInfo(),'x':[]};U._startTimer=setInterval(function(){var pi=U.getVal('page_id');if(pi){var obj=U.identityInfo('page_id')[0];obj['page_id']=pi;obj['page_state']='start_by_timer';U.start();}},100);U.register('domready',U.start);U.register('beforeunload',function(e){U.end();U.beforeunloadExist();});}})(window.UIMonitor2);